<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    {% load static %}

<link rel="stylesheet" href="{% static 'polls/style.css' %}">
    <title>投票中心 - 表达您的声音</title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
        }
        
        :root {
            --primary: #4e54c8;
            --secondary: #8f94fb;
            --accent: #ff6b6b;
            --light: #f8f9fa;
            --dark: #343a40;
            --success: #28a745;
            --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
            --transition: all 0.3s ease;
        }
        
        body {
            background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
            min-height: 100vh;
            padding: 20px;
            color: var(--dark);
            line-height: 1.6;
        }
        
        .container {
            max-width: 800px;
            margin: 0 auto;
            padding: 40px 20px;
        }
        
        header {
            text-align: center;
            margin-bottom: 40px;
            position: relative;
            padding-bottom: 20px;
        }
        
        header::after {
            content: '';
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 4px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            border-radius: 2px;
        }
        
        h1 {
            font-size: 2.8rem;
            margin-bottom: 10px;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
            text-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        
        .subtitle {
            font-size: 1.2rem;
            color: #6c757d;
            max-width: 600px;
            margin: 0 auto;
        }
        
        .card {
            background: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
            overflow: hidden;
            margin-bottom: 25px;
            transition: var(--transition);
            transform: translateY(0);
        }
        
        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
        }
        
        .card-header {
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            color: white;
            padding: 15px 20px;
            font-weight: 600;
            font-size: 1.2rem;
            display: flex;
            align-items: center;
        }
        
        .poll-icon {
            margin-right: 12px;
            font-size: 1.4rem;
        }
        
        .card-body {
            padding: 25px;
        }
        
        .poll-list {
            list-style: none;
            margin-top: 20px;
        }
        
        .poll-item {
            padding: 15px 20px;
            margin-bottom: 15px;
            border-radius: 8px;
            background-color: #f8f9ff;
            display: flex;
            align-items: center;
            transition: var(--transition);
            border-left: 4px solid var(--primary);
        }
        
        .poll-item:hover {
            background-color: #edf0ff;
            transform: translateX(5px);
        }
        
        .poll-link {
            text-decoration: none;
            color: var(--dark);
            font-size: 1.1rem;
            font-weight: 500;
            display: flex;
            align-items: center;
            width: 100%;
        }
        
        .poll-link::after {
            content: '→';
            margin-left: auto;
            color: var(--primary);
            font-weight: bold;
            opacity: 0;
            transition: var(--transition);
        }
        
        .poll-item:hover .poll-link::after {
            opacity: 1;
            transform: translateX(5px);
        }
        
        .poll-number {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 28px;
            height: 28px;
            background: linear-gradient(135deg, var(--primary), var(--secondary));
            color: white;
            border-radius: 50%;
            margin-right: 15px;
            font-weight: bold;
            font-size: 0.9rem;
        }
        
        .no-polls {
            text-align: center;
            padding: 40px 20px;
            background: white;
            border-radius: 12px;
            box-shadow: var(--shadow);
        }
        
        .no-polls-icon {
            font-size: 3rem;
            color: #dee2e6;
            margin-bottom: 20px;
        }
        
        .no-polls p {
            font-size: 1.2rem;
            color: #6c757d;
            margin-bottom: 20px;
        }
        
        .btn {
            display: inline-block;
            background: linear-gradient(90deg, var(--primary), var(--secondary));
            color: white;
            padding: 12px 28px;
            border-radius: 50px;
            text-decoration: none;
            font-weight: 600;
            transition: var(--transition);
            border: none;
            cursor: pointer;
            font-size: 1rem;
            box-shadow: 0 4px 10px rgba(78, 84, 200, 0.3);
        }
        
        .btn:hover {
            transform: translateY(-3px);
            box-shadow: 0 7px 15px rgba(78, 84, 200, 0.4);
        }
        
        .stats {
            display: flex;
            justify-content: space-between;
            margin-top: 30px;
            padding: 15px 20px;
            background: rgba(143, 148, 251, 0.1);
            border-radius: 12px;
            font-size: 0.9rem;
            color: #495057;
        }
        
        .stats-item {
            display: flex;
            align-items: center;
        }
        
        .stats-icon {
            margin-right: 8px;
            color: var(--primary);
        }
        
        footer {
            text-align: center;
            margin-top: 50px;
            color: #6c757d;
            font-size: 0.9rem;
            padding: 20px;
        }
        
        @media (max-width: 600px) {
            .container {
                padding: 20px 10px;
            }
            
            h1 {
                font-size: 2.2rem;
            }
            
            .card-header {
                padding: 12px 15px;
                font-size: 1.1rem;
            }
            
            .poll-link {
                font-size: 1rem;
            }
            
            .stats {
                flex-direction: column;
                gap: 10px;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <header>
            <h1>请选择您要投票的选项</h1>
            <p class="subtitle">参与投票，表达您的声音，每个选择都很重要</p>
        </header>
        
        {% if latest_question_list %}
            <div class="card">
                <div class="card-header">
                    <span class="poll-icon">📊</span>
                    当前可投票项
                </div>
                <div class="card-body">
                    <ul class="poll-list">
                        {% for question in latest_question_list %}
                            <li class="poll-item">
                                <a href="{% url 'polls:detail' question.id %}" class="poll-link">
                                    <span class="poll-number">{{ forloop.counter }}</span>
                                    {{ question.question_text }}
                                </a>
                            </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
            
            <div class="stats">
                <div class="stats-item">
                    <span class="stats-icon">⏱️</span>
                    实时投票 | 最新更新
                </div>
                <div class="stats-item">
                    <span class="stats-icon">👥</span>
                    已有 1,284 人参与
                </div>
                <div class="stats-item">
                    <span class="stats-icon">✅</span>
                    完全匿名 | 安全可靠
                </div>
            </div>
        {% else %}
            <div class="no-polls">
                <div class="no-polls-icon">📭</div>
                <p>当前没有可用的投票项</p>
                <a href="#" class="btn">创建新投票</a>
            </div>
        {% endif %}
        
        <footer>
            <p>© 2025 投票中心 | 每个声音都值得被听见 <a href="/admin">管理</a></p>
        </footer>
    </div>
</body>
</html>